
include ../Makefile.Res
Version:=1.0
ModuleName:=upgrade

Object:=Upgrade.patch

Object_Dir_Tmp:=Upgrade_Tmp

Object_ini:=config.ini
Object_exec:=exec.sh
Object_dev_exec:=upgrade.sh
Object_default_config:=../web/encode_html/config.xml
Object_patch:=patch.tar.gz
Object_version:=issue

.PHONY: all clean dist_clean

all:

patch: Upgrade.patch

$(Object): $(Object_patch) $(Object_ini)
	if [ ! -d $(Object_Dir_Tmp) ]; then mkdir $(Object_Dir_Tmp); else rm -rf $(Object_Dir_Tmp)/*; fi
	cp -rf $(Object_ini) $(Object_exec) $(Object_dev_exec) $(Object_patch) $(Object_version) $(Object_default_config) \
	$(Object_Dir_Tmp)
	tar czvf $(Object) $(Object_Dir_Tmp)

$(Object_ini): create_config_ini.php
	chmod +x ./create_config_ini.php
	./create_config_ini.php
	
$(Object_patch):
	cp -rf ../../patch ./ 
	cp -rf ../../_install/etc/$(Object_version) ./
	tar czvf patch.tar.gz patch

clean:
	rm -rf $(Object_ini) $(Object_patch) $(Object) $(Object_Dir_Tmp) patch $(Object_version)

dist_clean:clean
